using System.Collections;
using System.Collections.Generic;
using PEProtocol;
using PNet;
using UnityEngine;

public class LoginToken : IOCPToken<NetMsg>
{
    protected override void Connected(bool result)
    {
        if (result)
        {
            PERoot.Instance.NetService.AddMsg(new NetMsg(CMD.OnClient2LoginConnected));
        }
        else
        {        
            this.LogGreen($"Client login connected failed!");
        }


    }

    protected override void OnReceiveMsg(NetMsg msg)
    {
        PERoot.Instance.NetService.AddMsg(msg);
    }

    protected override void OnDisconnected()
    {
        this.LogGreen($"Client login disconnected!");
        PERoot.Instance.NetService.AddMsg(new NetMsg(CMD.OnClient2LoginDisconnected));
    }
}
